<#include "/common/new.html" /> <@layout>
<head>

</head>
<style>
html,body {
	width: 100%;
	height: 100%;
	background-color: #FFFFFF;
}
html,body {
	margin: 0;
	border: 0 none;
	padding: 0;
}

body {
	font-size: 1em;
	font-family: "Microsoft Yahei", "黑体", monospace;
}

.title,.content p {
	display: none;
	color: #2ae0c8;
}
</style>
<style>
.swiper-container,.swiper-slide {
	width: 100%;
	height: 100%;
}
</style>

<body>

<header class="app-header">
		<a href="#"  id="start" onclick="openaudio();" class="u-globalAudio z-pause">
		<i class="icon-pause"></i></a>
		<a href="#"  id="end" onclick="end();" class="u-globalAudio z-pause">
		<i class="icon-forward"></i></a>
		<audio src="${ctx}/img/new/QT007_music.mp3" id="audios" autoplay="autoplay" loop="loop"></audio>
		<span class=""></span>
		<div class="coffee-steam-box"
		 style="height: 100px; width: 50px; left: 36px; top: -50px; position: absolute; overflow: hidden; z-index: 0;"></div>
	</header>
	<div class="ace-settings-container" id="ace-settings-container"
	style="top: 6%">
	<div class="btn btn-app btn-mini btn-warning ace-settings-btn"
		id="ace-settings-btn">
		<i class="icon-cog bigger-150"></i>
	</div>

	<div class="ace-settings-box" id="ace-settings-box"
		style="width: 200px">
		<form class="form-horizontal">
			<div class="control-group">
				页面布局<select id="mbbhs" name="mbbhs" style="width: 100px"
					onchange="changestyle()">
					<option value="1">单图</option>
					<option value="2">上图下文</option>
					<option value="3">文字封腰</option>
					<option value="4">上文下图</option>
					<option value="5">粗黑文字</option>
				</select>
			</div>
			<div class="control-group">
				图片动画<select id="imgtx" style="width: 100px" onchange="changetx()">
					<option value="flipx">上下翻转特效</option>
					<option value="flipy">左右翻转特效</option>
					<option value="fadedownbig">上下淡入特效</option>
					<option value="fadeleftbig">左右淡入特效</option>
					<option value="rotatein">旋转特效</option>
				</select>
			</div>
			<div class="control-group">
				<div style="white-space: nowrap;">
					<div class="dropdown dropdown-colorpicker">
						颜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;色

						<div class="btn-group">
							<button data-toggle="dropdown" id="colobtn"
								class="  btn-large dropdown-toggle"
								style="background-color: #fad165; border-color: #fad165">
								颜色选择 <i class="icon-angle-down icon-on-right"></i>
							</button>
							<ul class="dropdown-menu dropdown-success pull-right">
								<li class="colorpick-btn" style="background-color: #ac725e;"><a
									data-color="#ac725e" href="#">&nbsp; </a></li>
								<li class="colorpick-btn" style="background-color: #d06b64;"><a
									data-color="#d06b64" href="#">&nbsp; </a></li>
								<li class="colorpick-btn" style="background-color: #f83a22;"><a
									data-color="#f83a22" href="#">&nbsp; </a></li>
								<li class="colorpick-btn" style="background-color: #fa573c;"><a
									data-color="#fa573c" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #ff7537;"><a
									data-color="#ff7537" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #ffad46;"><a
									data-color="#ffad46" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #42d692;"><a
									data-color="#42d692" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #16a765;"><a
									data-color="#16a765" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #7bd148;"><a
									data-color="#7bd148" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #b3dc6c;"><a
									data-color="#b3dc6c" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #fbe983;"><a
									data-color="#fbe983" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #fad165;"><a
									data-color="#fad165" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #92e1c0;"><a
									data-color="#92e1c0" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #9fe1e7;"><a
									data-color="#9fe1e7" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #9fc6e7;"><a
									data-color="#9fc6e7" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #4986e7;"><a
									data-color="#4986e7" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #9a9cff;"><a
									data-color="#9a9cff" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #b99aff;"><a
									data-color="#b99aff" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #c2c2c2;"><a
									data-color="#c2c2c2" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #cabdbf;"><a
									data-color="#cabdbf" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #cca6ac;"><a
									data-color="#cca6ac" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #FFFFFF;"><a
									data-color="#FFFFFF" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #cd74e6;"><a
									data-color="#cd74e6" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #a47ae2;"><a
									data-color="#a47ae2" class="colorpick-btn" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #555;"><a
									data-color="#555" class="colorpick-btn" href="#">&nbsp; </a></li>
								<li class="colorpick-btn" style="background-color: #000000;"><a
									data-color="#000000" class="colorpick-btn selected" href="#">&nbsp;
								</a></li>
								<li class="colorpick-btn" style="background-color: #f691b2;"><a
									data-color="#f691b2" class="colorpick-btn" href="#">&nbsp;
								</a></li>
							</ul>
						</div>

					</div>

				</div>
			</div>

			<div class="control-group">
				<a class="btn btn-app btn-info btn-small" onclick="chooseImage()">
					<i class="icon-picture bigger-160"></i> 选择图片
				</a> <a class="btn btn-app btn-danger btn-small" onclick="uploadImage()">
					<i class="icon-picture bigger-160"></i> 上传图片
				</a>
			</div>
			<div class="control-group">
				<a class="btn btn-app btn-pink btn-small" onclick="startRecord()">
					<i class="icon-fast-forward bigger-180"></i> 录制声音
				</a> <a class="btn btn-app btn-light btn-small" onclick="stopRecord()">
					<i class="icon-pause bigger-160"></i> 停止录音
				</a>
			</div>
			<div class="control-group">
				<a class="btn btn-app btn-success btn-small" onclick="editwz()">
					<i class="icon-edit bigger-160"></i>文字编辑
				</a>
			</div>
			<div class="control-group">
				<a class="btn btn-primary btn-block" onclick="saves()">确定</a>
			</div>
		</form>
	</div>
	</br> </br> </br> </br> </br> </br> </br>
</div>
 
	<div class="swiper-container">
		<!-- 滑动操作指示 -->
		<!-- 主体 -->
		<div class="swiper-wrapper">
		<#list mbsxlist as m>
		<input type=text value="${(m.id)}">
			<div class="swiper-slide slide${(m.id)}"
				style="background: url('') no-repeat center center; background-color: white; background-size: 100% 100%;">
					<input type="hidden" name="lbids${m_index}" id="lbids${m_index}" value="${(m.lbid)}">
					<input type="hidden" name="ids${m_index}" id="ids${m_index}" value="${(m.id)}">
				<div class="${(m.tx)!}" id="imgdiv${(m.id)}"
					style="height:100% ;width:100%;">
					<img  id="urls${(m.id)}"
						src="${ctx}${(m.url)}" 
						style="<#if (m.mbbh=="1")>	height: "100%";width : "100%";left : "0px";top : "0px";</#if>
						<#if (m.mbbh=="2")>	height: "60%";width : "100%";left : "0px";top : "0px";</#if>
						<#if (m.mbbh=="3")>	height: "100%";width : "100%";left : "0px";top : "0px";</#if>
						<#if (m.mbbh=="4")>	height: "60%";width : "100%";left : "0px";top : "60%";</#if>
						<#if (m.mbbh=="5")>	height: "100%";width : "100%";left : "0px";top : "0px";</#if>" />
				</div>
				<div class="${(m.tx)!}" id="nrs${(m.id)}"
					style="font-size:25px;color:black; background-color: white; 
					<#if (m.mbbh=="1")>	height: "100%";width : "100%";left : "0px";top : "0px";</#if>
					<#if (m.mbbh=="2")>	height: "40%";width : "100%";left : "0px";top : "60%";</#if>
					<#if (m.mbbh=="3")>	height: "30%";width : "100%";left : "0px";top : "40%";</#if>
					<#if (m.mbbh=="4")>	height: "40%";width : "100%";left : "0px";top : "0px";</#if>
					<#if (m.mbbh=="5")>	height: "50%";width : "100%";left : "0px";top : "60%";background-color:"";</#if>">
					${(m.nr)!}
				</div>
			</div>
			</#list>
		</div>
	</div>
	<div id="dialog-message" class="hide">
				<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<textarea class="autosize-transition span12" name="nra" id="nra"></textarea>
					</div>
				</div>
			</div>
		</div><!-- #dialog-message -->
	<form id="myform"  >
<input type="hidden" name="mbsxid" id="mbsxid">
<input type="hidden" name="lbid" id="lbid" >
<input type="hidden" name="mbbh" id="mbbh" >
<input type="hidden" name="nr" id="nr" >
<input type="hidden" name="url" id="url" >
<input type="hidden" name="bs" id="bs" >
<input type="hidden" name="style" id="stylea"> 
<input type="hidden" name="medaid" id="medaid" >
<input type="hidden" name="contentid" id="contentid" value="${(contentid)!}">
<input type="hidden" name="color" id="color">
<input type="hidden" name="tx" id="tx">
</form>
</body>

<#include "/common/end.html" /> 

<script>
	
	var argu = '${(argu)!}';
	<#list mblist as m>
	<#if (m.gkzt)??> 
	<#if (m.gkzt)=="1">
		argu="edit";
	</#if>
	</#if>
	<#if (m.gkzt)??> 
	<#if (m.gkzt)=="0">
		argu="view";
	</#if>
	</#if>
	</#list>
	if (argu == "view") {
		function onBridgeReady() {
			WeixinJSBridge.call('hideOptionMenu');
		}

		if (typeof WeixinJSBridge == "undefined") {
			if (document.addEventListener) {
				document.addEventListener('WeixinJSBridgeReady', onBridgeReady,
						false);
			} else if (document.attachEvent) {
				document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
				document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
			}
		} else {
			onBridgeReady();
		}
	}

</script>
<script>

function editwz(){
		 $("#ace-settings-btn").trigger("click")
		 var dialog = $( "#dialog-message" ).dialog({
             modal: false,
             width: "80%",
			 title: "修改文字内容",
             title_html: true,
             overlay: {
                 backgroundColor: '#000',
                 opacity: 0.5
             },
             buttons: [
                 {
                     text: "确定",
                     "class" : "btn btn-primary btn-mini ",
                     click: function() {
                    		var id=$("#mbsxid").val();
                    		var nra=$("#nra").val();
						$("#nrs"+id).html(nra);
						$("#nr").attr("value",nra);
                       $( this ).dialog( "close" );
                     }
                 },
                 {
                     text: "取消",
                     "class" : "btn btn-mini btn-danger ",
                     click: function() {
                         $( this ).dialog( "close" );
                     }
                 }
             ]
         }); 

}

</script>
<script>
wx.config({
    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: '${(appId)!}', // 必填，公众号的唯一标识
    timestamp:'${(timestamp)!}' , // 必填，生成签名的时间戳
    nonceStr: '${(nonceStr)!}', // 必填，生成签名的随机串
    signature: '${(signature)!}',// 必填，签名，见附录1
    jsApiList: ['startRecord','stopRecord','onVoiceRecordEnd',
                'playVoice','pauseVoice','stopVoice','onVoicePlayEnd','uploadVoice',
                'downloadVoice','chooseImage','previewImage','uploadImage',
                'downloadImage','translateVoice','getNetworkType','openLocation',
                'getLocation','hideOptionMenu','showOptionMenu','hideMenuItems',
                'showMenuItems','hideAllNonBaseMenuItem','showAllNonBaseMenuItem',
                'closeWindow','scanQRCode','chooseWXPay'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
});

wx.error(function(res){
		alert("微信js验证验证失败！");
    // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。

});
//获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
wx.onMenuShareTimeline({
    title: '', // 分享标题
    link: '', // 分享链接
    imgUrl: '', // 分享图标
    success: function () { 
        // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
        // 用户取消分享后执行的回调函数
    }
});

//获取“分享给朋友”按钮点击状态及自定义分享内容接口
wx.onMenuShareAppMessage({
    title: '', // 分享标题
    desc: '', // 分享描述
    link: '', // 分享链接
    imgUrl: '', // 分享图标
    type: '', // 分享类型,music、video或link，不填默认为link
    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
    success: function () { 
        // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
        // 用户取消分享后执行的回调函数
    }
});

//获取“分享到QQ”按钮点击状态及自定义分享内容接口
wx.onMenuShareQQ({
    title: '', // 分享标题
    desc: '', // 分享描述
    link: '', // 分享链接
    imgUrl: '', // 分享图标
    success: function () { 
       // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
       // 用户取消分享后执行的回调函数
    }
});
//获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口
wx.onMenuShareWeibo({
    title: '', // 分享标题
    desc: '', // 分享描述
    link: '', // 分享链接
    imgUrl: '', // 分享图标
    success: function () { 
       // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
        // 用户取消分享后执行的回调函数
    }
});
//5 图片接口
// 5.1 拍照、本地选图
var images = {
  localId: [],
  serverId: []
};
function chooseImage(){
    wx.chooseImage({
        success: function (res) {
          images.localId = res.localIds;
          alert('已选择 ' + res.localIds.length + ' 张图片');
        }
      });
}

//预览图片接口
wx.previewImage({
    current: '', // 当前显示的图片链接
    urls: [] // 需要预览的图片链接列表
});
//上传图片接口
//5.3 上传图片
function uploadImage(){
	if (images.localId.length == 0) {
		alert("请先选择图片或者拍照！");
		return;
	  }
	  var i = 0, length = images.localId.length;
	  images.serverId = [];
	 // function upload() {
	    wx.uploadImage({
	      localId: images.localId[i],
	      success: function (res) {
	    	  alert(res.serverId);
	    	  $("#medaid").attr("value",res.serverId);
	    	  var urla = '${ctx}/wxContent/getimg/';
	          $('#myform').form('submit', {
	              url : urla,
	              onSubmit : function() {
	              },
	              success : function(data) {
	                  // 回填页面
	                  	var id=$("#mbsxid").val();
	                	$("#urls"+id).attr("src", "${ctx}" + data);
	                  images.localId.length=0;
	              }
	          });
//	        alert('已上传：' + i + '' + length);
	    //    images.serverId.push(res.serverId);
//	        if (i < length) {
//	          upload();
//	        }
	        
	      },
	      fail: function (res) {
	        alert(JSON.stringify(res));
	      }
	    });
	//  }
	//  upload();
}

//下载图片接口

wx.downloadImage({
    serverId: '', // 需要下载的图片的服务器端ID，由uploadImage接口获得
    isShowProgressTips: 1, // 默认为1，显示进度提示
    success: function (res) {
        var localId = res.localId; // 返回图片下载后的本地ID
    }
});
//音频接口
//3.1 识别音频并返回识别结果

//3 智能接口
var voice = {
  localId: '',
  serverId: ''
};
// 4 音频接口
// 4.2 开始录音
function startRecord(){
	  wx.startRecord({
		    cancel: function () {
		      alert('用户拒绝授权录音');
		    }
		  });
}

// 4.3 停止录音
function stopRecord(){
	  wx.stopRecord({
		    success: function (res) {
		      voice.localId = res.localId;
		      var urla = '${ctx}/wxContent/getvoice/';
	          $('#myform').form('submit', {
	              url : urla,
	              onSubmit : function() {
	              },
	              success : function(data) {
	                  // 回填页面
	                  voice.localId="";
	              }
	          });
		    },
		    fail: function (res) {
		      alert(JSON.stringify(res));
		    }
		  });
}


// 4.4 监听录音自动停止
wx.onVoiceRecordEnd({
  complete: function (res) {
    voice.localId = res.localId;
    alert('录音时间已超过一分钟');
  }
});

// 4.5 播放音频
function playVoice(){
	  if (voice.localId == '') {
		    alert('请先录制一段声音');
		    return;
		  }
		  wx.playVoice({
		    localId: voice.localId
		  });
}


// 4.6 暂停播放音频
function pauseVoice(){
	  wx.pauseVoice({
		    localId: voice.localId
		  });
}


// 4.7 停止播放音频
function stopVoice(){
	  wx.stopVoice({
		    localId: voice.localId
		  });
}


// 4.8 监听录音播放停止
wx.onVoicePlayEnd({
  complete: function (res) {
    alert('录音（' + res.localId + '）播放结束');
  }
});

// 4.8 上传语音
function uploadVoice(){
	  if (voice.localId == '') {
		    alert('请先录制一段声音');
		    return;
		  }
		  wx.uploadVoice({
		    localId: voice.localId,
		    success: function (res) {
		      alert('上传语音成功，serverId 为' + res.serverId);
		      voice.serverId = res.serverId;
		    }
		  });
}


//地理位置

//使用微信内置地图查看位置接口

wx.openLocation({
    latitude: 0, // 纬度，浮点数，范围为90 ~ -90
    longitude: 0, // 经度，浮点数，范围为180 ~ -180。
    name: '', // 位置名
    address: '', // 地址详情说明
    scale: 1, // 地图缩放级别,整形值,范围从1~28。默认为最大
    infoUrl: '' // 在查看位置界面底部显示的超链接,可点击跳转
});
//获取地理位置接口
wx.getLocation({
    success: function (res) {
        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
        var speed = res.speed; // 速度，以米/每秒计
        var accuracy = res.accuracy; // 位置精度
    }
});
</script>
<script>

function changestyle(){
	var id=$("#mbsxid").val();
	var types=$("#mbbhs").val();
	$("#mbbh").attr("value",types);
	 if (types == "1") {
			$("#imgdiv"+id).css({
				"height" : "100%",
				"width" : "100%",
				"left" : "0px",
				"top" : "0px"
			});
			$("#nrs"+id).css({
				"height" : "100%",
				"width" : "100%",
				"left" : "0px",
				"top" : "0px"
			});
			$("#nrs"+id).html("");
		} else if (types == "2") {
			$("#imgdiv"+id).css({
				"height" : "60%",
				"width" : "100%",
				"left" : "0px",
				"top" : "0px"
			});
			$("#nrs"+id).css({
				"height" : "40%",
				"width" : "100%",
				"left" : "0px",
				"top" : "60%"
			});
		//	$("#nrs"+id).html("111111");
		} else if (types == "3") {
			$("#imgdiv"+id).css({
				"height" : "100%",
				"width" : "100%",
				"left" : "0px",
				"top" : "0px"
			});
			$("#nrs"+id).css({
				"height" : "30%",
				"width" : "100%",
				"left" : "0px",
				"top" : "40%"
			});
		} else if (types == "4") {
			$("#imgdiv"+id).css({
				"height" : "60%",
				"width" : "100%",
				"left" : "0px",
				"top" : "40%"
			});
			$("#nrs"+id).css({
				"height" : "40%",
				"width" : "100%",
				"left" : "0px",
				"top" : "0"
			});
		} else if (types == "5") {
			$("#imgdiv"+id).css({
				"height" : "100%",
				"width" : "100%",
				"left" : "0px",
				"top" : "0px"
			});
			$("#nrs"+id).css({
				"height" : "50%",
				"width" : "100%",
				"left" : "0px",
				"top" : "60%",
				"background-color":""
			});
		} 
}

function changetx(){
	var id=$("#mbsxid").val();
	var imgtx=$("#imgtx").val();
	$("#imgdiv"+id).removeClass();
	$("#imgdiv"+id).addClass(imgtx);
	$("#tx").attr("value",imgtx);
}
$(".colorpick-btn").click(function(e){
	var id=$("#mbsxid").val();
	 var co = $(e.target).attr('data-color'); 
	  $(".colorpick-btn").removeClass("selected");
	  $(e.target).attr("class",'colorpick-btn selected'); 
	  $(".btn-colorpicker").css({"background-color":co});
	  var id=$("#mbsxid").val();
	  if(id!=""){
			//$("#span"+id).css({"color":co});
	  }
	  $("#color").attr("value",co);
	  $("#nrs"+id).css({"color":co});
});

function saves(){
	 var url=$("#url").val();
	  if(url==""){
		  alert("请选择图片并上传！");
		//  return;
	  } 
	  var urla = '${ctx}/wxContent/saveCy/';
      $('#myform').form('submit', {
          url : urla,
          onSubmit : function() {
          },
          success : function(data) {
              // 回填页面
              if(data=="1"){
            	  alert("此页面制作成功！");
            	  $("#nr").attr("value","");
            	  $("#url").attr("value","");
            	  $("#color").attr("value","");
            	  $("#tx").attr("value","");
              }
          }
      });
}
</script>

<script>
wx.config({
    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: '${(appId)!}', // 必填，公众号的唯一标识
    timestamp:'${(timestamp)!}' , // 必填，生成签名的时间戳
    nonceStr: '${(nonceStr)!}', // 必填，生成签名的随机串
    signature: '${(signature)!}',// 必填，签名，见附录1
    jsApiList: ['startRecord','stopRecord','onVoiceRecordEnd',
                'playVoice','pauseVoice','stopVoice','onVoicePlayEnd','uploadVoice',
                'downloadVoice','chooseImage','previewImage','uploadImage',
                'downloadImage','translateVoice','getNetworkType','openLocation',
                'getLocation','hideOptionMenu','showOptionMenu','hideMenuItems',
                'showMenuItems','hideAllNonBaseMenuItem','showAllNonBaseMenuItem',
                'closeWindow','scanQRCode','chooseWXPay'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
});
if(/Android (\d+\.\d+)/.test(navigator.userAgent)){
	var version = parseFloat(RegExp.$1);
	if(version>2.3){
		var phoneScale = parseInt(window.screen.width)/640;
		document.write('<meta name="viewport" content="width=640, minimum-scale = '+ phoneScale +', maximum-scale = '+ phoneScale +', target-densitydpi=device-dpi">');
	}else{
		document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
	}
}else{
	document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
}
//微信去掉下方刷新栏
if(navigator.userAgent.indexOf('MicroMessenger') >= 0){
	document.addEventListener('WeixinJSBridgeReady', function() {
		//WeixinJSBridge.call('hideToolbar');
	});
}
$(function(){
	 $("#end").hide();
	var x = document.getElementById("audios");
	x.play();
  var mySwiper = $('.swiper-container').swiper({
    mode:'vertical',
    loop: true,
	mousewheelControl:true,
	keyboardControl:true,
	onSlideChangeStart:function(){
		},
		onSlideChangeEnd:function(){
			var i=mySwiper.activeLoopIndex;
			var id=$("#ids"+i).val();
			var lbid=$("#lbids"+i).val();
			alert(i);
			$("#mbsxid").attr("value",id);//模板顺序
			$("#lbid").attr("value",lbid);//类别
			$("#bs").attr("value",i);
/* 	$('.content p').each($).show(1000).wait(1600);
 */	},
		onSwiperCreated:function(){
	//	$('.title').wait(500).slideDown().delay(500).animate({fontSize:"250%",color:"red",display:"block"},3000,"swing");
//$('.text p').each($).show(1000).wait(1600);
		} 
    
  });
  //赋值初始值
    $("#mbsxid").attr("value",$("#ids0").val());
    $("#lbid").attr("value",$("#lbids0").val());

})
function openaudio(){
	var x = document.getElementById("audios");
	x.play();
	$("#end").show();
	$("#start").hide();
}
function end(){
	var x = document.getElementById("audios");
	x.pause();
	$("#end").hide();
	$("#start").show();
}
</script>
</@layout>
